<!DOCTYPE html>
<html>
<head>

 <meta charset="utf-8">
 <meta name="viewport" content="width=device-width, initial-scale=1.0">

 <title>消息中心控制台</title>
 <link rel="shortcut icon" href="../resource/favicon.ico">
 <link href="../resource/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
 <link href="../resource/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
 <link href="../resource/lib/datatable/css/jquery.dataTables.css" rel="stylesheet">
 <link href="../resource/lib/datatable/css/dataTables.jqueryui.css" rel="stylesheet">
 <link href="../resource/lib/datatable/css/jquery.dataTables_themeroller.css" rel="stylesheet">

 <link href="../resource/css/animate.min.css" rel="stylesheet">
 <link href="../resource/css/style.min862f.css?v=4.1.0" rel="stylesheet">

 <style>
  /* 输入框和下拉框圆角  */
  .borderRadius input {
   border-radius: 4px;
  }

  .borderRadius select {
   border-radius: 4px;
  }

 </style>

</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
 <!--查询面板-->
 <div class="panel panel-default">
  <div class="ibox-form">
   <form id="templateForm" class="form-horizontal borderRadius" role="form">
    <div class="row">

       <div class="col-sm-3">
        <div class="form-group">
         <label class="col-sm-4 control-label">应用名称</label>
         <div class="col-sm-8">
          <select id="appSearch" class="form-control" name="appId">
          </select>
         </div>
        </div>
       </div>
       <div class="col-sm-3">
        <div class="form-group">
         <label class="col-sm-4 control-label">模板名称</label>
         <div class="col-sm-8">
          <input class="form-control" id="name" placeholder="请输入名称" name="name" type="text" autocomplete="off">
         </div>
        </div>
       </div>
       <div class="col-sm-3">
        <div class="form-group">
         <label class="col-sm-4 control-label">状态</label>
         <div class="col-sm-8">
          <select class="form-control" name="enable">
           <option value="">全部</option>
           <option value="true">已启用</option>
           <option value="false">已禁用</option>
          </select>
         </div>
        </div>
       </div>
    </div>
   </form>

   <!-- 保存|取消 -->
   <div class="row">
    <div class="col-sm-12">
     <div style="text-align: right">
      <button class="btn btn-primary" onclick="search()">查询</button>
      <button class="btn btn-primary" onclick="reset()">重置</button>
     </div>
    </div>
   </div>
  </div>
 </div>

 <!--表格面板-->
 <div class="row">
  <div class="col-sm-12">
   <div style="margin-bottom: 5px">
    <button type="button" id="createBtn" class="btn btn-primary" data-toggle="modal" data-target="#createModal">新增</button>
   </div>
   <div class="panel panel-default">
    <div class="panel-body">
     <table id="templateTable"
            class="table table-condensed margin-top10" style="word-break:break-all;"></table>
    </div>
   </div>
  </div>
 </div>
</div>

<!-- 模态框 - 创建 -->
<div class="modal fade" id="createModal" tabindex="-1" role="dialog" aria-labelledby="createModalLabel" aria-hidden="true">
 <div class="modal-dialog" style="width: 1000px">
  <div class="modal-content">
   <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
    <h4 class="modal-title" id="createModalLabel">创建</h4>
   </div>
   <div class="modal-body">
    <form id="createForm" class="form-horizontal borderRadius" role="form">


       <div class="form-group">
        <label class="col-sm-4 control-label">应用名称<span style="color: red;margin-left: 5px">*</span></label>
        <div class="col-sm-8">
         <select id="appAdd" class="form-control" name="appId">
         </select>
        </div>
       </div>


       <div class="form-group">
        <label class="col-sm-4 control-label">模板名称<span style="color: red;margin-left: 5px">*</span></label>
        <div class="col-sm-8">
         <input class="form-control" name="name" placeholder="请输入模板名称" type="text" autocomplete="off">
        </div>
       </div>

       <div class="form-group">
        <label class="col-sm-4 control-label">状态<span style="color: red;margin-left: 5px">*</span></label>
        <div class="col-sm-8">
         <select class="form-control" name="enable">
          <option value="true">已启用</option>
          <option value="false">已禁用</option>
         </select>
        </div>
       </div>


       <div class="form-group">
        <label class="col-sm-4 control-label">主题<span style="color: red;margin-left: 5px">*</span></label>
        <div class="col-sm-8">
         <input class="form-control" name="subject" placeholder="请输入主题" type="text" autocomplete="off">
        </div>
       </div>


       <div class="form-group">
        <label class="col-sm-4 control-label">内容<span style="color: red;margin-left: 5px">*</span></label>
        <div class="col-sm-8">
         <textarea class="form-control" name="text" placeholder="请输入内容" type="text" autocomplete="off"></textarea>
        </div>
       </div>

     <div class="form-group">
      <label class="col-sm-4 control-label">描述</label>
      <div class="col-sm-8">
       <textarea class="form-control" name="desc" placeholder="请输入描述" type="text" autocomplete="off"></textarea>
      </div>
     </div>

    </form>
   </div>
   <div class="modal-footer">
    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
    <button type="button" class="btn btn-primary" onclick="create()">确认</button>
   </div>
  </div>
 </div>
</div>

<!-- 模态框 - 修改 -->
<div class="modal fade" id="updateModal" tabindex="-1" role="dialog" aria-labelledby="updateModalLabel" aria-hidden="true">
 <div class="modal-dialog" style="width: 1000px">
  <div class="modal-content">
   <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
    <h4 class="modal-title" id="updateModalLabel">修改</h4>
   </div>
   <div class="modal-body">
    <form id="updateForm" class="form-horizontal borderRadius" role="form">
     <div class="form-group" style="display: none">
      <label class="col-sm-4 control-label">ID</label>
      <div class="col-sm-8">
       <input class="form-control" name="id" type="text" autocomplete="off">
      </div>
     </div>


     <div class="form-group">
      <label class="col-sm-4 control-label">应用名称<span style="color: red;margin-left: 5px">*</span></label>
      <div class="col-sm-8">
       <input class="form-control" name="appName" type="text" autocomplete="off" readonly="readonly">
      </div>
     </div>

       <div class="form-group">
        <label class="col-sm-4 control-label">模板名称<span style="color: red;margin-left: 5px">*</span></label>
        <div class="col-sm-8">
         <input class="form-control" name="name" placeholder="请输入模板名称" type="text">
        </div>
       </div>


       <div class="form-group">
        <label class="col-sm-4 control-label">状态<span style="color: red;margin-left: 5px">*</span></label>
        <div class="col-sm-8">
         <select class="form-control" name="enable">
          <option value="true">已启用</option>
          <option value="false">已禁用</option>
         </select>
        </div>
       </div>


       <div class="form-group">
        <label class="col-sm-4 control-label">主题<span style="color: red;margin-left: 5px">*</span></label>
        <div class="col-sm-8">
         <input class="form-control" name="subject" placeholder="请输入主题" type="text">
        </div>
       </div>


       <div class="form-group">
        <label class="col-sm-4 control-label">内容<span style="color: red;margin-left: 5px">*</span></label>
        <div class="col-sm-8">
         <textarea class="form-control" name="text" placeholder="请输入内容" type="text"></textarea>
        </div>
       </div>

     <div class="form-group">
      <label class="col-sm-4 control-label">描述</label>
      <div class="col-sm-8">
       <textarea class="form-control" name="desc" placeholder="请输入描述" type="text"></textarea>
      </div>
     </div>

    </form>
   </div>
   <div class="modal-footer">
    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
    <button type="button" class="btn btn-primary" onclick="update()">确认</button>
   </div>
  </div>
 </div>
</div>

<script>
 let searchUrl = "http://127.0.0.1:9091/api/common/template/list-page"
 let createUrl = "http://127.0.0.1:9091/api/common/template/create"
 let deleteUrl = "http://127.0.0.1:9091/api/common/template/delete"
 let updateUrl = "http://127.0.0.1:9091/api/common/template/update"
 let searchAppUrl = "http://127.0.0.1:9091/api/common/app/list-all"
</script>

<script src="../resource/js/jquery.min.js?v=2.1.4"></script>
<script src="../resource/js/bootstrap.min.js?v=3.3.6"></script>
<script src="../resource/lib/datatable/js/jquery.dataTables.min.js"></script>
<script src="../resource/lib/axios/axios.min.js"></script>
<script src="../resource/js/formPublic.js"></script>
<script src="../resource/js/common.js"></script>
<script src="../app/app_common.js"></script>
<script src="template.js"></script>


</body>
</html>
